<html xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout"
      layout:decorator="layout/blank"><!-- layout文件路径-->
<head>
    <title>编辑Video</title>
</head>
<body>
<div layout:fragment="content">
    <div class="content-frame">
        <div class="content-frame-right">
            <div class="row">
                <div class="col-md-12">
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            <h3 class="panel-title">上传资料</h3>
                            <ul class="panel-controls">
                                <li><a href="#" class="panel-remove"><span class="fa fa-times"></span></a></li>
                            </ul>
                        </div>

                        <div class="panel-body">
                            <h4>上传封面:</h4>
                            <div class="block push-up-10">
                                <form id="coverForm" class="dropzone dropzone-mini dz-clickable">
                                    <div class="dz-default dz-message"><span>上传截图</span></div>
                                </form>
                            </div>
                        </div>
                    </div>
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            <h3 class="panel-title">上传视频</h3>
                            <ul class="panel-controls">
                                <li><a href="#" class="panel-remove"><span class="fa fa-times"></span></a></li>
                            </ul>
                        </div>

                        <div class="panel-body">

                            <div class="block push-up-10">
                                <h4>上传视频:</h4>
                                <form id="videoForm" class="dropzone dropzone-mini dz-clickable">
                                    <div class="dz-default dz-message"><span>上传视频</span></div>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="content-frame-body content-frame-body-left">

            <div class="row">
                <div class="col-md-12">

                    <form class="form-horizontal" id="videoLessonForm" >
                        <div class="panel panel-default">
                            <div class="panel-heading">
                                <h3 class="panel-title" th:if="${isEdit} eq 'add'">新增</h3>
                                <h3 class="panel-title" th:if="${isEdit} eq 'edit'">编辑</h3>
                                <ul class="panel-controls">
                                    <li><a href="#" class="panel-remove"><span class="fa fa-times"></span></a></li>
                                </ul>
                            </div>

                            <div class="panel-body">

                                <div class="form-group">
                                    <label class="col-md-3 col-xs-12 control-label">课程名称</label>
                                    <div class="col-md-6 col-xs-12">
                                        <div class="input-group">
                                            <span class="input-group-addon"><span class="fa fa-pencil"></span></span>
                                            <input type="text" class="form-control" required name="title" th:if="${isEdit} eq 'add'"/>
                                            <input type="text" class="form-control" required name="title" th:value="${videoLesson.title}" th:if="${isEdit} eq 'edit'"/>
                                        </div>
                                        <span class="help-block">填写名称，必填</span>
                                    </div>
                                </div>
                                <input type="hidden" name="id" th:if="${isEdit} eq 'add'"/>
                                <input type="hidden" name="id" th:value="${videoLesson.id}" th:if="${isEdit} eq 'edit'"/>
                                <input type="hidden" name="levelId" id="levelId" th:value="${levelId}"/>


                                <div class="form-group">
                                    <label class="col-md-3 col-xs-12 control-label">副标题</label>
                                    <div class="col-md-6 col-xs-12">
                                        <div class="input-group">
                                            <span class="input-group-addon"><span class="fa fa-pencil"></span></span>
                                            <input type="text" class="form-control" name="subtitle"
                                                   th:if="${isEdit} eq 'add'"/>
                                            <input type="text" class="form-control" name="subtitle"
                                                   th:value="${videoLesson.subtitle}" th:if="${isEdit} eq 'edit'"/>
                                        </div>
                                        <span class="help-block">填写课程副标题，必填</span>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-md-3 col-xs-12 control-label">是否免费</label>
                                    <div class="col-md-6 col-xs-12">
                                        <select class="form-control select" name="free">
                                            <option th:value="0" th:selected="${videoLesson.free=='0'}"
                                                    th:text="免费"></option>
                                            <option th:value="1" th:selected="${videoLesson.free=='1'}" th:text="付费"></option>
                                        </select>
                                        <span class="help-block">选择课程属性，必填</span>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-md-3 col-xs-12 control-label">教师</label>
                                    <div class="col-md-6 col-xs-12">
                                        <select class="form-control select" name="type" th:if="${isEdit} eq 'add'">
                                            <option value="0" >--请选择老师--</option>
                                            <option th:each="teacher:${teachers}" th:value="${teacher.id}"
                                                    th:text="${teacher.name}"></option>
                                        </select>
                                        <select class="form-control select" name="type" th:if="${isEdit} eq 'edit'">
                                            <option value="0" >--请选择老师--</option>
                                            th:selected="${teacher.id==videoLesson.teacherId}"></option>
                                            <option th:each="teacher:${teachers}" th:value="${teacher.id}"
                                                    th:text="${teacher.name}"
                                                    th:selected="${teacher.id==videoLesson.teacherId}"></option>
                                        </select>
                                        <span class="help-block">请选择老师，非必填，如果是亲子课，可以选择</span>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-md-3 col-xs-12 control-label">初始播放量</label>
                                    <div class="col-md-6 col-xs-12">
                                        <div class="input-group">
                                            <span class="input-group-addon"><span class="fa fa-pencil"></span></span>
                                            <input type="number" class="form-control" name="playCount" th:if="${isEdit} eq 'add'"/>
                                            <input type="number" class="form-control" name="playCount" th:value="${videoLesson.playCount}" th:if="${isEdit} eq 'edit'"/>
                                        </div>
                                        <span class="help-block">填写课程副标题，必填</span>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-md-3 col-xs-12 control-label">封面</label>
                                    <div class="col-md-6 col-xs-12">
                                        <div class="input-group">
                                            <span class="input-group-addon"><span class="fa fa-pencil"></span></span>
                                            <input type="text" name="cover" class="form-control" required id="coverInput" th:if="${isEdit} eq 'add'"/>
                                            <input type="text" name="cover" class="form-control" required id="coverInput" th:value="${videoLesson.cover}" th:if="${isEdit} eq 'edit'"/>

                                        </div>
                                        <span class="help-block">右侧上传封面，必填</span>
                                    </div>
                                </div>


                                <div class="form-group">
                                    <label class="col-md-3 col-xs-12 control-label">视频</label>
                                    <div class="col-md-6 col-xs-12">
                                        <div class="input-group">
                                            <span class="input-group-addon"><span class="fa fa-pencil"></span></span>
                                            <input type="text" name="url" class="form-control" id="videoInput" th:if="${isEdit} eq 'add'"/>
                                            <input type="text" name="url" class="form-control" id="videoInput" th:value="${videoLesson.url}" th:if="${isEdit} eq 'edit'"/>
                                        </div>
                                        <span class="help-block">右侧上传视频</span>
                                    </div>
                                </div>

                            </div>
                            <div class="panel-footer">
                                <a class="btn btn-primary pull-right" id="submit-videoLesson-form-btn">提交</a>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>

</body>
</html>
